package br.gov.mi.corporativo.dominio.boundary.comum.uf;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;

import br.gov.mi.corporativo.dominio.entidade.comum.Uf;


@Path("ufs")
public class UfRestAdapter extends SpringBeanAutowiringSupport {


	@Autowired
	UfEndPoint service;
	
	
	@GET
	@Produces({MediaType.APPLICATION_JSON})
	public Iterable<Uf> recuperarTodos(){
		
		return service.recuperarTodos();
		
	}
	
	@GET
	@Path("/id/{id}")
	@Produces({MediaType.APPLICATION_JSON})
	public Uf recuperarPorId(@PathParam("id")Long id){
		return service.recuperarPorId(id);
	}
	
	
	@GET
	@Path("/sigla/{sigla}")
	@Produces({MediaType.APPLICATION_JSON})
	public Uf recuperarPorSigla(@PathParam("sigla")String sigla){
		return service.recuperarPorSigla(sigla);
	}
	
	
}
